from django.db import models

# Create your models here.
from django.db import models


class Activity(models.Model):
    '''活动模块数据库字段'''
    STATUS = ((1, '立即报名'), (2, '报名截止'), (3, '活动结束'))

    title = models.CharField(max_length=128, verbose_name='活动标题')
    image = models.CharField(max_length=128, verbose_name='活动图片')
    address = models.CharField(max_length=64, verbose_name='活动地址')
    start_time = models.DateTimeField(verbose_name='活动开始时间')
    end_time = models.DateTimeField(verbose_name='活动结束时间')
    deadline = models.DateTimeField(verbose_name='活动截止时间')
    city = models.CharField(max_length=32, verbose_name='举办城市')
    sponsor = models.CharField(max_length=64, verbose_name='举办方')
    status = models.IntegerField(choices=STATUS, verbose_name='活动状态')
    abstract = models.TextField(verbose_name='活动简介')
    details = models.TextField(verbose_name='活动详情')
    link = models.CharField(max_length=128, verbose_name='链接')
    is_delete = models.BooleanField(default=False)

    def __str__(self):
        return self.title

    class Meta:
        db_table = 'activity'
        verbose_name = '活动页面'
        verbose_name_plural = verbose_name
